package br.dcc.ufmg.thresholds;

public enum Threshold {

	CA (7.0f, 39.0f),
	CE (6.0f, 16.0f),
	VG (2.0f, 4.0f),
	DIT (2.0f, 4.0f),
	LCOM (0.167f, 0.725f),
	MLOC (10.0f, 30.0f),
	NBD (1.0f, 3.0f),
	NOC (11.0f, 28.0f),
	PAR (2.0f, 4.0f),
	RMD (0.467f, 0.750f),
	WMC (11.0f, 34.0f),
	NOF (3.0f, 8.0f),
	NOM (6.0f, 14.0f),
	NSC (1.0f, 3.0f),
	NRM (2.0f, 4.0f),
	SIX (0.019F, 1.33F),
	NSF (1.0f, 5.0f),
	NSM (1.0F, 3.0F);

	private Float thresholdCommon, thresholdUncommon;

	Threshold(Float thresholdCommon, Float thresholdUncommon) {
		this.thresholdCommon = thresholdCommon;
		this.thresholdUncommon = thresholdUncommon;
	}

	public Float getThresholdCommon() {
		return thresholdCommon;
	}

	public void setThresholdCommon(Float thresholdCommon) {
		this.thresholdCommon = thresholdCommon;
	}

	public Float getThresholdUncommon() {
		return thresholdUncommon;
	}

	public void setThresholdUncommon(Float thresholdUncommon) {
		this.thresholdUncommon = thresholdUncommon;
	}
	
	public static Threshold getByName (String metric) {
		for (Threshold threshold : Threshold.values()) {
			if (threshold.toString().equals(metric)) {
				return threshold;
			}
		}
		return null;
	}
}
